<template>
	<view class="about clearfix">
		<cu-custom bgColor="bg-white" isBack>
			<block slot="content">添加支付宝</block>
		</cu-custom>
		<view class="mt5 bg-white px15 flex align-center h55 f16">
			<view class="titles">姓名</view>
			<input v-model="name" placeholder-class="text-info" placeholder="请输入您的真实姓名" />
		</view>
		<view class="mt1 bg-white px15 flex align-center h55 f16">
			<view class="titles">支付宝号</view>
			<input v-model="idcard" placeholder-class="text-info" placeholder="请输入您要收款的支付宝号" />
		</view>
		<view class="flex align-start f12 py20 flex-wrap px15">
			<text class="text-red">注：</text>
			<text>请填入您</text>
			<text class="text-red">真实有效</text>
			<text>的姓名及支付宝号，已确保</text>
			<text>能提现成功到您的支付宝号上</text>
		</view>
		<view class="shiming-button discenter f16 text-white" @click="zfbbd">确认添加</view>
	</view>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
	data() {
		return {
			name:'',
			idcard:'',
		}
	},
	onLoad() {},
	methods: {
		...mapActions(['setUpdate']),
		async zfbbd() {
			if(this.name==''){
				uni.showToast({
					title:'请填写真实姓名',
					icon:'none'
				})
				return false
			}
			if(this.idcard==''){
				uni.showToast({
					title:'请填写支付宝账号',
					icon:'none'
				})
				return false
			}
			let params={
				userName:this.name,
				zfbNum:this.idcard,
			}
			let {data} = await this.$http.post('user.zfbbd', params, { tipConfig: { storeLoading: true, isSuccessTip: true, isSuccessBack: true, navigateBack: 1 } })
			this.setUpdate(true)
		}, 
	}
}
</script>

<style lang="less">
.titles{
	width:240rpx;
}
.shiming-button{
	width: calc(100% - 60rpx);
	margin-left: 30rpx;
	margin-top: 40rpx;
	height: 90rpx;
	border-radius: 10rpx;
	background-color: #D53932;
}
</style>
